import java.util.Scanner;

public class demo05 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int m=sc.nextInt();
        int[][] arr=new int[n][m];
        int t=sc.nextInt();
        for (int i = 0; i < t; i++) {
            int r1=sc.nextInt()-1;
            int c1=sc.nextInt()-1;
            int r2=sc.nextInt()-1;
            int c2=sc.nextInt()-1;
            for (int j = r1; j <= r2; j++) {
                for (int k = c1; k <= c2; k++) {
                    arr[j][k]=2;
                }
            }
        }
        int count=0;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if(arr[i][j]==0){
                    count++;
                }
            }
        }
        System.out.println(count);
    }
}
